package com.leaf.lowcode.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.leaf.lowcode.entity.Xfcurrent;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author cxd
 * @since 2021-11-10
 */
public interface XfcurrentMapper extends BaseMapper<Xfcurrent> {

    @Select("SELECT sum(mutuallyCurrentV),DATE_FORMAT(`date`,'%j') dayint FROM xfcurrent WHERE deviceCode=#{deviceCode} GROUP BY dayint")
    public List<String> Sumcount(@Param(value = "deviceCode") String deviceCode);

    @Select("SELECT sum(sumElectricityProduction),DATE_FORMAT(`date`,'%j') dayint FROM xfcurrent WHERE deviceCode=#{deviceCode} GROUP BY dayint ORDER BY dayint DESC")
    public List<String> sumElectricityProduction(@Param(value = "deviceCode") String deviceCode);

}